/* $Id: ClientRegistrationDelegate.java 
 * Copyright (C) 2011, TRAKHEES
 *  
 * Revision History
 *
 * Date  			Author 		    	Remarks
 * ---------------------------------------------------------------------------------
 *
 */
package ae.pcfc.etks.online.common.delegate;

import java.util.List;

import ae.pcfc.etks.online.common.vo.AdminApprovalVO;
import ae.pcfc.etks.online.common.vo.AppMetaDataDetailVO;
import ae.pcfc.etks.online.common.vo.ClientCompanyReqVO;
import ae.pcfc.etks.online.common.vo.ClientCompanyVO;
import ae.pcfc.etks.online.common.vo.ClientEmailVO;
import ae.pcfc.etks.online.common.vo.ClientPersonReqVO;
import ae.pcfc.etks.online.common.vo.ClientPersonVO;
import ae.pcfc.etks.online.common.vo.ClientRoleVO;
import ae.pcfc.etks.online.common.vo.CompanyDetailVO;
import ae.pcfc.etks.online.common.vo.SCCompanyVO;
import ae.pcfc.etks.online.common.vo.SCPersonVO;
import ae.pcfc.etks.online.common.vo.SearchCriteriaCompanyVO;
import ae.pcfc.etks.online.common.vo.SearchCriteriaPersonVO;
import ae.pcfc.etks.online.common.vo.TrakheesIdAndPINVO;
import ae.pcfc.etks.online.common.vo.UserVO;

public interface ClientRegistrationDelegate extends BaseDelegate {

	/**
	 * registerCompany
	 * Method to register client company
	 * @param clientCompanyReqVO
	 * @return
	 * String
	 */
	public String registerCompany(ClientCompanyReqVO clientCompanyReqVO);

	/**
	 * registerPerson
	 * Method to register client person
	 * @param clientPersonReqVO
	 * @return
	 * String
	 */
	public String registerPerson(ClientPersonReqVO clientPersonReqVO);

	/**
	 * validateTrakheesIdAndPIN
	 * Method to validate the Trakhees ID and PIN combination
	 * @param idAndPINVO
	 * @return
	 * boolean
	 */
	public boolean validateTrakheesIdAndPIN(TrakheesIdAndPINVO idAndPINVO);

	/**
	 * findSCPersonByTrakheesId
	 * Method to find Client Person by trakhees Id
	 * @param trakheesId
	 * @return
	 * SCPersonVO
	 */
	public SCPersonVO findSCPersonByTrakheesId(String trakheesId);

	/**
	 * findSCCompanyByTrakheesId
	 * Method to find client company by trakhees id
	 * @param trakheesId
	 * @return
	 * SCCompanyVO
	 */
	public SCCompanyVO findSCCompanyByTrakheesId(String trakheesId);

	/**
	 * findClientPersonByUserName
	 * Method to find client person by username
	 * @param userName
	 * @return
	 * ClientPersonVO
	 */
	public ClientPersonVO findClientPersonByUserName(String userName);

	/**
	 * findClientCompanyByUserName
	 * Method to find client company by username
	 * @param userName
	 * @return
	 * ClientCompanyVO
	 */
	public ClientCompanyVO findClientCompanyByUserName(String userName);

	/**
	 * findTrakheesIdByUserName
	 * Method to find client trakhees id by username who is registered with the client 
	 * @param userName
	 * @return
	 * String
	 */
	public String findTrakheesIdByUserName(String userName);

	/**
	 * updateClientPerson
	 * Method to update client person user information 
	 * @param userVO
	 * void
	 */
	public void updateClientPerson(UserVO userVO);

	/**
	 * updateClientCompany
	 * Method to update client company user information
	 * @param userVO
	 * void
	 */
	public void updateClientCompany(UserVO userVO);

	/**
	 * loadCompany
	 * Method to load a company detail by id 
	 * @param id
	 * @return
	 * CompanyDetailVO
	 */
	public CompanyDetailVO loadCompany(String id);
	
	/**
	 * findPersonAvailableRoleByUserName
	 * Method to find the roles a user can register which returns excluding active registered role requests and associated roles
	 * @param strUserName
	 * @return
	 * List<ClientRoleVO>
	 */
	public List<ClientRoleVO> findPersonAvailableRoleByUserName(String strUserName);
	
	/**
	 * addClientRoleReq
	 * Method to add client role request
	 * @param strUserName
	 * @param roleIds
	 * @param appMetaDataVO
	 * @return
	 * String
	 */
	public String addClientRoleReq(String strUserName, List<Long> roleIds, AppMetaDataDetailVO appMetaDataVO);
	
	/**
	 * findClientReqRoleByApplicationId
	 * Method to find client role request by application id
	 * @param applicationId
	 * @return
	 * List<ClientRoleVO>
	 */
	public List<ClientRoleVO> findClientReqRoleByApplicationId(String applicationId);
	
	/**
	 * reviewClientRoleRequest
	 * Method to process the admin approval action on the client role request
	 * @param adminApprovalVO
	 * void
	 */
	public void reviewClientRoleRequest(AdminApprovalVO adminApprovalVO);
	
	/**
	 * findTrakheesIdByApplicationId
	 * Method to find trakhees id of a client by the id of the application  
	 * @param applicationId
	 * @return
	 * String
	 */
	public String findTrakheesIdByApplicationId(String applicationId);
	
	/**
	 * findTrakheesIdAndPinByEmail
	 * Method to find trakhees id and Pin by email address of the client
	 * @param email
	 * @return
	 * TrakheesIdAndPINVO
	 */
	public TrakheesIdAndPINVO findTrakheesIdAndPinByEmail(String email);
	
	/**
	 * recallClientTrakheesID
	 * Method to recall the client trakhees id which emails the ID and pin 
	 * @param clientEmail
	 * void
	 */
	public void recallClientTrakheesID(ClientEmailVO clientEmail);

	/**
	 * findTrakheesIdAndPinByLicenseInfo
	 * 
	 * @param searchCriteriaCompanyVO
	 * @return
	 * TrakheesIdAndPINVO
	 */
	public TrakheesIdAndPINVO findTrakheesIdAndPinByLicenseInfo(SearchCriteriaCompanyVO searchCriteriaCompanyVO);

	public List<ClientRoleVO> findCurrentRolesByUserName(String strUserName);
	
	public List<SCCompanyVO> findCompany(SearchCriteriaCompanyVO searchCriteriaCompanyVO);
	
	public List<SCPersonVO> findPerson(SearchCriteriaPersonVO searchCriteriaPersonVO);
	
}
